import request from "../utils/requestjs.js"

interface LoginData{
    username:string,
    password:string,
    kehuyan:string
}
interface REGISTER{
    username:string,
    password:string,
}
///注册
export const POSTLOGIN =(data: LoginData)=>{
    return request({
        url:"/user/login",
        method:"POST",
        data
    })
}
///注册
export const POSTREGIS  =(data:REGISTER)=>{
    return request({
        url:"/user/registry",
        method:"POST",
        data
    })
}
//获取数据

export const GETHOUSE =()=>{
    return request({
        url:"/renting",
        method:"GET"
    })
}
///添加数据
export const ADDDATA =(data)=>{
    return request({
        url:"/addHouse",
        method:"POST",
        data
    })
}

///房源数据
export const GETINFO =(params:any)=>{
    return request({
        url:"/api/v1/infos",
        method:"GET",
        params
    })
}
///房源的删除
export const DELETELIST =(id:any)=>{
    return request({
        url:"/deleteMarkethouses/"+id,        
        method:"DELETE",
       
    })
}

///房源的修改
export const EDITHOUSE =(data:any)=>{
    return request({
        url:"/editHouses",        
        method:"POST",
        data
    })
}
//查询
export const CHAHOUSE =(params:any)=>{
    return request({
        url:"/housing",        
        method:"GET",
        params
    })
}
//二手房
export const GETTWO =()=>{
    return request({
        url:"/second/housing",        
        method:"GET",
 
    })
}
//经纪人接口
export const GETBROKER =(params:any)=>{
    return request({
        url:"/api/v1/broker",
        method:"GET",
        params
    })
}
//修改经纪人
export const XIUGAIJINJI =(params:any)=>{
    return request({
        url:"/alterMarketBroker",
        method:"POST",
        params
    })
}


export const LiveDate =(params:any)=>{
    return request({
        url:"/live",
        method:"GET",
        params
    })
}
export const UPLIVE =(data:any)=>{
    return request({
        url:"/updateLive",
        method:"POST",
        data
    })
}
export const DELECTLIVE =(params:any)=>{
    return request({
        url:"/delLive",
        method:"DELETE",
        params
    })
}
